package in.muton.edushare.summary.html;

import in.muton.edushare.wicket.models.CayenneList;

import java.util.Iterator;

import org.apache.wicket.markup.repeater.data.IDataProvider;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

public class TableDateProvider<T> implements IDataProvider<IModel<T>> {
	private static final long serialVersionUID = -7661628155513803013L;

	public TableDateProvider(CayenneList<T> l) {
		this.userList = l;
	}

	public Iterator<? extends IModel<T>> iterator(int arg0, int arg1) {
		return userList.getObject().subList(arg0, arg1).iterator();
	}

	public IModel<IModel<T>> model(IModel<T> arg0) {
		return new Model<IModel<T>>(arg0);
	}

	public int size() {
		return userList.getObject().size();
	}

	public void detach() {
	}

	private CayenneList<T> userList;
}
